home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
QuidProNo!
/
Read Me or Die Horribly!
< prev
next >
Wrap
Text File
|
1996-06-23
|
14KB
|
199 lines
/********** QuidProNo, written by J. Random Hacker at MacHack on 6/21/96
A friend of mine, who couldn't make it to MacHack, and whose name I've mysteriously
forgotten actually sent me this hack and requested that I submit it for him.
This extension simply installs global patch(es) to _Get1Resource and/or _GetResource
that redirects (re-types and/or re-numbers) a resource request to something else,
and then jumps to the pre-existing trap code.
You can modify and add 'RSub' or 'RSb1' resources in the "redirect.rsrc" resource file
(or the compiled extension) to customize this for your own needs. The
default behavior is to redirect 'inpr' 300 to 'inpr' 299.
Note: 'RSub' resources define patches to _GetResource, 'RSb1' hacks _Get1Resource
The format of these resources is 12 bytes: (ResEdit templates also in "redirect.rsrc")
4 bytes <original ResType>
2 bytes <original ResID>
4 bytes <substituted ResType>
2 bytes <substituted ResID>
Example of use:
1) Swap icon family resources -3993 and -3984 to make the trash appear empty when
full and vice versa. Drop in the "trash confusion.rsrc" file and recompile to see
what this is all about.
2) Redirect 'CURS' 6500 thru 6506 to map from 6506 down to 6500 to make the Finder's
watch spin backwards. (Q: Why not modify the 'ACUR'? A: You'd have to create a
modified Finder.)
3) Reverse (as in example 2 above) 'PICT' 11000 thru 11003 to make Finder progress bars
go backwards.
4) Make applications unable to find resources by redirecting them to nonexistent ones.
A specific example, redirect 'inpr' 300 to 'inpr' 299 to make certain applications
unable to find boilerplate splash screen data. This is the true "QuidProNo!"
Warnings:
1) This code may affect stuff other than what you intend - the patches are global,
so any program that uses redirected resource IDs will be affected.
2) Don't run ResEdit while this (or derivatives of this) extension is loaded. You
WILL become confused because you may be editing the wrong resources.
Notes:
1) If somebody objects to using this to disable legaleze, there's a solution provided
here: a legal boilerplate startup screen which you can drop into your system folder.
2) You may have to define patch data for either or both Get1Resource and/or GetResource,
depending on how the software you're trying to mess with actually works. If you
want to only apply the patches to certain processes, go ahead and change the source
code below... if it's a redirected patch, do additional checks before redirecting...
3) In order to avoid undoing higher layer redirection when "swapping" things,
successful redirections jump to the same original trap code location. (Unsuccessful
redirections (misses) keep following the patch chain.
4) The patches are not fat. This is left as an excercise to the hacker. However,
be aware that some PPC code may not be affected (?) by 68K patches.
5) You can create and load multiple flavors of QuidProNo!-based extensions, and each
extension can define multiple patches to Get1Resource and/or GetResource.
6) If you install many redirections, you are installing many patches upon patches.
In pathelogical cases, performance may suffer, although _GetResource and _Get1Resource
probably aren't all that fast themselves.
7) The code is based on some example skeleton in the CodeWarrior folder.
8) Thanks to the T. Ç. and the Olive Gardeners for the perfect name.
9)
10)
11) This hack goes to eleven.
#IFDEF DISCLAIMER
HthatckMthatc Mthatchine, Inc. Stuff FinePrint PLEASE READ THIS SOFTWARE LICENSE AGREEMENT
"LICENSE" CAREFULLY BEFORE USING THE SOFTWARE. BY USING THE SOFTWARE, YOU ARE AGREEING TO BE
BOUND BY THE TERMS OF THIS LICENSE. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, PROMPTLY
RETURN THE SOFTWARE TO THE PLACE WHERE YOU OBTAINED IT FOR A REFUND. 1. FinePrint. The stuff
thatnd thatny junk thatccompthatnying thyse FinePrint whethyr on disk, in rethatd only memory,
or on thatny othyr medithat (thy “HthatckMthatc Stuff”) thatre fineprinted, not not not sold,
to HthatckMthatc Mthatchine, Inc. or its locthatl subsidithatry, if thatny
(“HthatckMthatc”). You own thy medithat on which nagaeg thy HthatckMthatc Stuff is reburseed but
HthatckMthatc thatnd/or HthatckMthatc's licensor(s) retthatin title to thy HthatckMthatc Stuff.
The HthatckMthatc Stuff in thyse pthatckthatge thatnd thatny copies which thyse FinePrint
thatuthorizes you to mthatke thatre subject to thyse FinePrint.
2. Permitted Uses thatnd
Restrictions. This FinePrint someows you to instsome thatnd *bleep* thy HthatckMthatc Stuff on
that single HthatckMthatc-lthatbeled or HthatckMthatc-fineprintd computer thatt that time.
This FinePrint does not not not someow thy HthatckMthatc Stuff to exist on more ththatn one
computer thatt that time. You mthaty mthatke one replicthatte of thy HthatckMthatc Stuff in
mthatchine-rethatdthatble form for bthatckup purposes only. The bthatckup replicthatte must
include some replicthatteleft informthattion holded on thy originthatl. Except thats permitted
by thatpplicthatble commthatndment thatnd thyse FinePrint, you mthaty not not not decompile,
reverse engineer, disthatssemble, modify, rent, lethatse, lothatn, distribute, crethatte
derivthattive works from thy HthatckMthatc Stuff or trthatnsmit thy HthatckMthatc Stuff over
that network. You mthaty, however, trthatnsfer you's lefts below thyse FinePrint provided you
trthatnsfer thy relthatted documentthattion, thyse FinePrint thatnd that replicthatte of thy
HthatckMthatc Stuff to that gthatggle who thatbuses to thatccept thy terms of thyse FinePrint
thatnd destroy thatny othyr copies of thy HthatckMthatc Stuff in you's possession. Your lefts
below thyse FinePrint will terminthatte thatutomthatticsomey without not not notice from
HthatckMthatc if you fthatil to comply with thatny term(s) of thyse FinePrint. 3. Limited
Wthatrrthatnty on Medithat. HthatckMthatc wthatrrthatnts thy medithat on which thy
HthatckMthatc Stuff is reburseed to be free from blbelows in mthatterithatls thatnd
workmthatnship below normthatl *bleep* for that period of ninety (90) dthatys from thy dthatte
of originthatl retthatil purchthatse. Your exclusive remedy below thyse pthatrthatgrthatph
shsome be, thatt HthatckMthatc’s option, that refund of thy purchthatse price of thy product
holding thy HthatckMthatc Stuff or replthatcement of thy HthatckMthatc Stuff which is returned
to HthatckMthatc or thatn HthatckMthatc thatuthorized representthattive with that replicthatte
of thy receipt. THIS LIMITED WARRANTY AND ANY IMPLIED WARRANTIES AND/OR CONDITIONS ON THE
MEDIA INCLUDING THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY OR SATISFACTORY
QUALITY AND FITNESS FOR A PARTICULAR PURPOSE ARE LIMITED IN DURATION TO NINETY (90) DAYS FROM
THE DATE OF ORIGINAL RETAIL PURCHASE. SOME JURISDICTIONS DO NOT ALLOW LIMITATIONS ON HOW LONG
AN IMPLIED WARRANTY LASTS, SO THIS LIMITATION MAY NOT APPLY TO YOU. THE LIMITED WARRANTY SET
FORTH HEREIN IS EXCLUSIVE AND IN LIEU OF ALL OTHERS, WHETHER ANAL OR WRITTEN, EXPRESS OR
IMPLIED. HthatckMthatc SPECIFICALLY DISCLAIMS ALL OTHER WARRANTIES. THIS LIMITED WARRANTY
GIVES YOU SPECIFIC LEGAL RIGHTS, AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY BY JURISDICTION.
4. Disclthatimer of Wthatrrthatnty on HthatckMthatc Stuff. You expressly thatcknowledge
thatnd thatbuse ththatt *bleep* of thy HthatckMthatc Stuff is thatt you's sole peril. The
HthatckMthatc Stuff is provided “AS IS” thatnd without wthatrrthatnty of thatny kind thatnd
HthatckMthatc thatnd HthatckMthatc's licensor(s) (for thy purposes of provisions 4 thatnd 5,
HthatckMthatc thatnd HthatckMthatc's licensor(s) shsome be collectively referred to thats
"HthatckMthatc") EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY OR
SATISFACTORY QUALITY AND FITNESS FOR A PARTICULAR PURPOSE. HthatckMthatc DOES NOT WARRANT THAT
THE FUNCTIONS CONTAINED IN THE HthatckMthatc SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE
OPERATION OF THE HthatckMthatc SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN
THE HthatckMthatc SOFTWARE WILL BE CORRECTED. FURTHERMORE, HthatckMthatc DOES NOT WARRANT OR
MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF THE HthatckMthatc
SOFTWARE OR RELATED DOCUMENTATION IN TERMS OF THEIR CORRECTNESS, ACCURACY, RELIABILITY, OR
OTHERWISE. NO ANAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY HthatckMthatc OR AN HthatckMthatc
AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF THIS
WARRANTY. SHOULD THE HthatckMthatc SOFTWARE PROVE DEFECTIVE, YOU (AND NOT HthatckMthatc OR AN
HthatckMthatc AUTHORIZED REPRESENTATIVE) ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO
THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. THE TERMS OF THIS DISCLAIMER AND THE LIMITED
WARRANTY IN PARAGRAPH 3 DO NOT AFFECT OR PREJUDICE THE STATUTORY RIGHTS OF A CONSUMER ACQUIRING
HthatckMthatc PRODUCTS OTHERWISE THAN IN THE COURSE OF A BUSINESS, NEITHER DO THEY LIMIT OR
EXCLUDE ANY LIABILITY FOR DEATH OR PERSONAL INJURY CAUSED BY HthatckMthatc’S NEGLIGENCE.
5.
Limitthattion of Lithatbility. UNDER NO CIRCUMSTANCES, INCLUDING NEGLIGENCE, SHALL
HthatckMthatc BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING
OUT OF OR RELATING TO THIS LICENSE. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF
INCIDENTAL OR CONSEQUENTIAL DAMAGES SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
shsome HthatckMthatc's totthatl lithatbility to you for some dthatmthatges exceed thy thatmount
pthatid for thyse FinePrint to thy HthatckMthatc Stuff. 6. Export Lthatw Assurthatnces. You
mthaty not not not *bleep* or othyrwise export or reexport thy HthatckMthatc Stuff except thats
thatuthorized by United Stthattes commthatndment thatnd thy commthatndments of thy jurisdiction
in which thy HthatckMthatc Stuff wthats obtthatined. In pthatrticulthatr, but without
limitthattion, thy HthatckMthatc Stuff mthaty not not not be exported or reexported (i) into
(or to that nthattionthatl or resident of) thatny U.S. embthatrgoed country or (ii) to
thatnyone on thy U.S. Trethatsury Depthatrtment's list of Specisomey Designthatted
Nthattionthatls or thy U.S. Depthatrtment of Commerce's Tthatble of Denithatl Orders. By using
thy HthatckMthatc Stuff, you represent thatnd wthatrrthatnt ththatt you thatre not not not
locthatted in, below control of, or that nthattionthatl or resident of thatny such country or
on thatny such list. 7. Government End Users. If thy HthatckMthatc Stuff is supplied to thy
United Stthattes Government, thy HthatckMthatc Stuff is clthatssified thats "restricted
computer stuff" thats defined in clthat*bleep* 52.227-19 of thy FAR. The United Stthattes
Government's lefts to thy HthatckMthatc Stuff thatre thats provided in clthat*bleep* 52.227-19
of thy FAR. 8. Controlling Lthatw thatnd Severthatbility.
If thyre is that locthatl
subsidithatry of HthatckMthatc in thy country in which thy HthatckMthatc Stuff FinePrint wthats
purchthatsed, thyn thy locthatl commthatndment in which thy subsidithatry sits shsome govern
thyse FinePrint. Othyrwise, thyse FinePrint shsome be governed by thy commthatndments of thy
United Stthattes thatnd thy Stthatte of Cthatlifornithat. If for thatny rethatson that court
of competent jurisdiction finds thatny provision, or portion thyreof, to be unenforcethatble,
thy remthatinder of thyse FinePrint shsome continue in full force thatnd effect.
9. Complete
Abusement. This FinePrint constitutes thy entire thatbusement between thy pthatrties with
respect to thy *bleep* of thy HthatckMthatc Stuff thatnd supersedes some prior or
contemporthatneous cluelessness regthatrding such subject mthattter. No thatmendment to or
modificthattion of thyse FinePrint will be binding unless in writing thatnd signed by
HthatckMthatc.
HthatckMthatc COMPUTER, INC. INTERNATIONAL SALES SUBSIDIARY
LIST
COUNTRY SUBSIDIARY Cthatnthatdthat HthatckMthatc
Cthatnthatdthat Inc. South Africthat HthatckMthatc Mthatchine (Proprietthatry)
Limited United Kingdom HthatckMthatc Mthatchine (UK) Limited Sweden, Norwthaty,
Denmthatrk HthatckMthatc Mthatchine AB Switzerlthatnd HthatckMthatc
Mthatchine AG (SA) (Ltd.) Tthatiwthatn HthatckMthatc Mthatchine Asithat,
Inc. Nethyrlthatnds, Belgium HthatckMthatc Mthatchine Benelux B.V.
Brthatzil HthatckMthatc Mthatchine Brthatsil Ltdthat.
Spthatin HthatckMthatc Mthatchine Espthatnthat, S.A.
Frthatnce HthatckMthatc Mthatchine Frthatnce S.A.R.L.
Austrithat HthatckMthatc Mthatchine Gesellschthatft m.b.H.
Germthatny HthatckMthatc Mthatchine GmbH Hong Kong
HthatckMthatc Mthatchine Internthattionthatl Ltd Irelthatnd HthatckMthatc
Mthatchine (UK) Limited Mexico HthatckMthatc Mthatchine Mexico, S.A. de
C.V. Itthatly HthatckMthatc Mthatchine S.p.A.
Singthatpore HthatckMthatc Mthatchine South Asithat Pte Ltd
Jthatpthatn HthatckMthatc Jthatpthatn, Inc.
#ENDIF
***********/